/*
    This source file is part of GeNa project.
    Copyright © GeNa project 2008
    For the latest info, see http://code.google.com/p/genaproject/ or  http://lumpyproject.forums-rpg.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Foobar is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>. */

#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED

#include <vector>
#include <string>

//Boost serialization
#include <boost/archive/basic_archive.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/version.hpp>


#include <boost/filesystem/path.hpp>

using namespace std;
using namespace boost::serialization;
using namespace boost::filesystem;

#include "brush.h"
#include "windows_manager.h"

class MapBasePane : public wxPanel
{
public:
    MapBasePane(Map* _map, wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = _("panel")) : wxPanel(parent, id, pos, size, style, name)
    {
        map = _map;
    }

    Map* map;
};

class Map
{
public:
    Map();
    ~Map();

    string filename;
    path mapPath;

    WindowsManager* mgr;
    class ActionManager* actionMgr;


    class ModelManager* modelManager;



    list<Group*> groups; //List of groups of brushes
    list<class Model*> models; //List of models

    list<Map*> included_map;

    //Action
    list<Model*> selectedModels;

    //Current
    //Functions
    void loadWindowsManager();
    bool printMessageAndEventuallyDestroy(bool asCancel = true);

    void select( math::vector3q p, math::vector3a v);
    void unselect( math::vector3q p, math::vector3a v);
    void  unselectAll();

    void draw(bool noEffect = false);

    template<class Archive> void serialize(Archive & ar, const unsigned int version);

};

BOOST_CLASS_VERSION(Map, 0)



#endif // MAP_H_INCLUDED
